﻿using System;
using System.Data;
using DevExpress.ExpressApp;
using DevExpress.Xpo.DB;
using DevExpress.Xpo.Metadata;

namespace Liekhus.Win.DataLayer
{
    public class InMemoryDataStoreProvider : IXpoDataStoreProvider
    {
        private DataSet dataSet;
        public InMemoryDataStoreProvider() : this(new DataSet()) { }
        public InMemoryDataStoreProvider(DataSet dataSet)
        {
            this.dataSet = dataSet;
        }
        public IDataStore CreateWorkingStore(out IDisposable[] disposableObjects)
        {
            disposableObjects = null;
            return new InMemoryDataStore(AutoCreateOption.DatabaseAndSchema);
        }
        public IDataStore CreateUpdatingStore(out IDisposable[] disposableObjects)
        {
            disposableObjects = null;
            return new InMemoryDataStore(AutoCreateOption.DatabaseAndSchema);
        }
        public string ConnectionString
        {
            get { return null; }
        }
        public XPDictionary XPDictionary
        {
            get { return null; }
        }
    }
}
